# -*- codeing = utf-8 -*-
# @Time:2021/9/25 17:18
# @Author:wcx
# @File:3.py
# @Software:PyCharm

import numpy as np
from fractions import Fraction as FC
import matplotlib.pyplot as plt
def random_pick():
    result = []
    pro = []
    for i in range(0,18):
        x = np.random.uniform(0,1)
        if x <= 0.3:
           result.append(1)
           pro.append(0.3)
        elif x >0.3 and x <= 0.5:
            result.append(2)
            pro.append(0.2)
        elif x > 0.5 and x <= 0.6:
            result.append(3)
            pro.append(0.1)
        else :
            result.append(4)
            pro.append(0.4)
    print(result)
    print(pro)
    plt.figure(figsize=(10, 10), dpi=100)
    plt.scatter(result,pro)
    plt.show()

# 主模块
if __name__ == "__main__":
    random_pick()